#include "Figure.h"
#include "Circle.h"
#include "Tri.h"
#include "Square.h"
#include <iostream>
using namespace std;

void objplay(Figure *base){
        cout<<base->getArea()<<endl;
}

int main(int argc, char const *argv[])
{
        //Figure f;  //抽象类不能被实例化
        //Figure *base = NULL;  //这个是可以的

        Circle c1(10, 20);
        Tri t1(20, 30);
        Square s1(50, 60);
        //cout<<c1.getArea()<<endl;

        //面向抽象类编程(面向一套预先定义好的接口编程)
        //解耦合...模块的划分
        objplay(&c1);
        objplay(&t1);
        objplay(&s1);

        return 0;
}